<?php
  function _get_mobile_userid()
{
    return SESSION(C('SESSION_PREFIX'));
}

function _get_mobile_username()
{
    return SESSION('USERNAME');
}


//获取客户端设备类型,苹果为ios,安卓android,否则为other
function get_client_device_type(){
    $agent = strtolower($_SERVER['HTTP_USER_AGENT']);
    $type = 2;
    if(strpos($agent, 'iphone') || strpos($agent, 'ipad')){
        $type = 2;
    }else if(strpos($agent, 'android')){
        $type = 1;
    }else{
        $type=3;
    }
    return $type;
}

?>




